# 2024/4/7 下午7:26 HFL
# 导包
import time

import pytest
from selenium import webdriver
from selenium.webdriver.common.by import By

from api.Base import Base



# 实例化对象
dri = Base()
dri.get('http://121.43.169.97:8081/common/member/login')
# 输入用户名
dri.input_text((By.CSS_SELECTOR, '[id="keywords1"]'),'13180577872')
# 输入密码
dri.input_text((By.CSS_SELECTOR, '[id="password"]'),'a123456')
# 点击登录
dri.click_element((By.ID, 'login-btn'))
time.sleep(2)
# 获取提示进行断言
res = dri.find_element((By.XPATH, '//*[@id="mlayout"]/div[2]/div[2]/div[2]/a'))
print(res)
time.sleep(2)
assert res
# 强制等待2秒
time.sleep(2)
# # 跳转页面进行断言
dri.driver.quit()
